/* test recursive data structures with function call as return value*/
struct list {
	int data;
	struct list * next;
};
/*@*/
void  delete(struct list* head)
{
	struct list * p;
	struct list * q;
	//p=head;
	q=head;
	while(head!=null)/*head!=null*/
	{
		print(head->data);	
		head=head->next;
                printp(q);
		free(q);
		q=head;
	}
	return ;
}
/*@*/
/*@*/
void main()
{
	struct list *head,test;
	struct list *p;
	struct list *q;
	int i;
	i=0;
	head=alloc(struct list);
	head->next=null;
	head->data=-1;
	p=head;
	q=head;
	while ( i<10)/*i>=0&&i<10*/
	{
		p= alloc(struct list);
		p->data=i*i;
		print(p->data);
		p->next=null;
		q->next=p;
		q=p;
		i=i+1;
	}
	p=head;
        printp(head);
	delete(head);
	return;
}
/*@*/
	

